package com.zret.oasys.factory;

import com.zret.oasys.operation.position.PositionServletOperation;

public class PositionServletFactory {
	// 返回值是operation继承的接口(为了多态)
			 public static PositionServletOperation getOpreation(String op)  {
				 String classStr = "com.zret.oasys.operation.position." + op;
				 //System.out.println(classStr);
				 Class<?> cla;
				 Object obj = null;
				try {
					cla = Class.forName(classStr);
					obj = cla.newInstance();
				} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				 
				 return (PositionServletOperation) obj;
			 }
}
